package com.abe.bathsystem.api.service;

import com.abe.bathsystem.entity.ReqBaseEntity;
import com.abe.bathsystem.entity.ReqBaseNoDataEntity;
import com.abe.bathsystem.entity.http.HttpAdEntity;
import com.abe.bathsystem.entity.http.HttpBathPosStateEntity;
import com.abe.bathsystem.entity.http.HttpNoticeEntity;
import com.abe.bathsystem.entity.http.HttpRoomEntity;
import com.abe.bathsystem.entity.http.HttpUserEntity;
import com.abe.bathsystem.entity.http.HttpVersionEntity;
import com.abe.bathsystem.utils.ConstantBath;

import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

public interface AppCommonService {
    @Multipart
    @POST(ConstantBath.UploadUrl)
    Call<ReqBaseEntity<Integer>> uploadFile(@Part MultipartBody.Part file);

    @FormUrlEncoded
    @POST(ConstantBath.ApiSaveLog)
    Call<ReqBaseNoDataEntity> saveLogData(@Field("roomId") String roomId, @Field("resId") String resId);

    @GET(ConstantBath.ApiVersion)
    Call<ReqBaseEntity<HttpVersionEntity>> checkVersion(@Query("pkg") String pkg);

    @FormUrlEncoded
    @POST(ConstantBath.ApiRoom)
    Call<ReqBaseEntity<HttpRoomEntity>> getRoomInfo(@Field("mac") String mac);

    @FormUrlEncoded
    @POST(ConstantBath.ApiLogin)
    Call<ReqBaseEntity<HttpUserEntity>> login(@Field("roomId") String roomId, @Field("os") String os, @Field("phone") String phone, @Field("pwd") String pwd);

    @FormUrlEncoded
    @POST(ConstantBath.ApiAd)
    Call<ReqBaseEntity<List<HttpAdEntity>>> getAdData(@Field("roomId") String roomId);

    @FormUrlEncoded
    @POST(ConstantBath.ApiUserData)
    Call<ReqBaseEntity<HttpUserEntity>> getUserData(@Field("phone") String phone);

    @FormUrlEncoded
    @POST(ConstantBath.ApiRoomStatus)
    Call<ReqBaseEntity<List<HttpBathPosStateEntity>>> getRoomStatus(@Field("roomId") String roomId);

    @FormUrlEncoded
    @POST(ConstantBath.ApiRoomReport)
    Call<ReqBaseNoDataEntity> report(@Field("roomId") String roomId, @Field("xiyu") String xiyu_json, @Field("chuifeng") String chuifeng, @Field("chongdian") String chongdian);

    @FormUrlEncoded
    @POST(ConstantBath.ApiUploadClientId)
    Call<ReqBaseNoDataEntity> upload(@Field("roomId") String roomId, @Field("clientId") String clientId, @Field("pushtype") String pushtype);


    @FormUrlEncoded
    @POST(ConstantBath.ApiOrderStart)
    Call<ReqBaseNoDataEntity> start(@Field("roomId") String roomId, @Field("type") int type, @Field("phone") String phone,
                                    @Field("position") String position, @Field("time") Long time);

    @GET(ConstantBath.ApiOrderEnd)
    Call<ReqBaseNoDataEntity> end(@QueryMap Map<String, Object> map);

    @GET(ConstantBath.ApiNotice)
    Call<ReqBaseEntity<List<HttpNoticeEntity>>> getNotice(@Query("roomId") String roomId);

    @FormUrlEncoded
    @POST(ConstantBath.ApiSensor)
    Call<ReqBaseNoDataEntity> uploadSensorInfo(@Field("roomId") String roomId, @Field("data") String sensorData);


}